Skip to content

feat: add block id, transaction id, certificate hash, and encode refactor#60

Merged
themantre merged 4 commits into
mainfrom
feat/block-id-encode
Jul 1, 2026
Merged

feat: add block id, transaction id, certificate hash, and encode refactor#60
themantre merged 4 commits into
mainfrom
feat/block-id-encode

Conversation

@b00f

@b00f b00f commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Block.id — blake2b-256 of header + cert_hash + merkle_root + tx_count (LE)
  • Transaction.id() — blake2b-256 of sign bytes
  • Certificate.hash() — blake2b-256 of encoded certificate
  • Simple merkle tree for TX root
  • Header.encode() — serializes header to bytes, used by Block
  • All encode methods now accept and return for clean chaining
  • BondPayload uses type with proper varint-prefixed encode/decode
  • Test verifies block id matches expected value

b00f added 4 commits July 1, 2026 03:20
Block 88888 contains 5 transactions: subsidy transfer + 3 sortitions + bond.
Validates header, certificate (51 committers), block ID, and all tx types.
@b00f b00f requested a review from themantre July 1, 2026 03:04
@themantre themantre merged commit d242a0a into main Jul 1, 2026
3 checks passed
@themantre themantre deleted the feat/block-id-encode branch July 1, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants